<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Play My Yii v1.0',
	// language specifications
	'language'=>'zh_cn',
	'sourceLanguage'=>'en_us',
	// default controller
	'defaultController'=>'site',
	// theme
	// 'theme'=>'plus',
	// preloading 'log' component
	'preload'=>array('log'),
	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.helpers.*',
		'zii.widgets.*',
	),
	//modules
	'modules'=>array(
	),
	// application components
	'components'=>array(
		// translation module language file type
		'messages' => array(
        'class' => 'CPhpMessageSource', //'CGettextMessageSource'
     ),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		// uncomment the following to enable URLs in path-format
		'urlManager'=>array(
			'showScriptName'=>false, // disable this when .htaccess takes effect on the host
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:page>/<view:\w+>'=>'<controller>/<action>',
				// '<controller:\w+>/<action:\w+>/<lang:\w+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		// uncomment the following to use a MySQL database
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=playmyii',
			'tablePrefix' => 'pmi_',
			'emulatePrepare' => true,
			'username' => 'ding',
			'password' => 'ding',
			'charset' => 'utf8',
			// cache db structure 
			// *remeber disable this if you manipulate db structure in actions!
			'schemaCachingDuration'=>3600,
		),
		'errorHandler'=>array(
				'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error',
				),
			),
		),
	),
	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>require(dirname(__FILE__).'/params.php'),
);